import {createMemoryHistory, createRouter, createWebHistory} from 'vue-router'
import Login from "@/component/Login.vue";
import Home from "@/component/Home.vue";
import Manager from "@/component/Manager.vue";
import Book from "@/component/Book.vue";
import Info from "@/component/Info.vue";

//路由的数组
//path 路径
//component 组件实例
//alt+enter 导包
//name
//"/"这是默认路径
export const routes = [
    { path: '/', component: Login,name:'login'},
    { path: '/home', component: Home,name:'home'},
    {
        path: '/manager', component: Manager,name:'manager',children:[
            {path:'book',component: Book,name:'book'},
            {path:'info',component: Info,name:'info'},
        ]
    },
]

//创建路由对象
 export const router = createRouter({
    history: createWebHistory(),
    routes,
})